<?php
/**
{
    "messageKeyId": "INT //模板消息id",
    "messageKey": "VARCHAR //prepay_id或form_id",
    "keyType": "TINYINT //类型@status; 1::下订单; 2::提交表单; ",
    "uid": "INT //用户@foreign::tbl_user; @search; ",
    "orderId": "INT //关联订单@foreign::tbl_order; @search; ",
    "usedCount": "INT //使用次数",
    "created": "DATETIME //创建时间"
}
 */

class MessageKey extends Base
{
    
	private $messageKeyId= '';//模板消息id
	private $messageKey= NULL;//prepay_id或form_id
	private $keyType= "1";//类型@status;1::下订单;2::提交表单;
	private $uid= '';//用户@foreign::tbl_user;@search;
	private $orderId= "0";//关联订单@foreign::tbl_order;@search;
	private $usedCount= "0";//使用次数
	private $created= 'CURRENT_TIMESTAMP';//创建时间

    public $isDbData = false;

    public function __construct()
    {
        parent::__construct();
    }


    public function __get($name) {
        return $this->$name;
    }

    public function __set($name, $value) {
        if(!$this->isDbData){
            if(!in_array($name,$this->loadedFiled))$this->loadedFiled[] = $name;
        }

        $this->$name=$value;
        $this->arr[$name] = $value;
    }

    public  function table()
    {
        return 'tbl_message_key';
    }
    
    public  function key(){
        return 'messageKeyId';
    }


    
    public static  function hideField()
    {
        return [];
    }
            
    public static  function skipField()
    {
        return [];
    }
            
    public static  function noViewField()
    {
        return [];
    }
            
    public static  function jsonField()
    {
        return [];
    }
            
    public static  function noLoadField()
    {
        return [];
    }
            
    public static  function deleteField()
    {
        return [];
    }
            
    public function className()
    {
        return 'MessageKey';
    }
    
    public  function field()
    {
        return array (  'messageKeyId' =>   array (    0 => 'INT',    1 => 11,    2 => '模板消息id',  ),  'messageKey' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => 'prepay_id或form_id',  ),  'keyType' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '类型@status;1::下订单;2::提交表单;',  ),  'uid' =>   array (    0 => 'INT',    1 => 11,    2 => '用户@foreign::tbl_user;@search;',  ),  'orderId' =>   array (    0 => 'INT',    1 => 11,    2 => '关联订单@foreign::tbl_order;@search;',  ),  'usedCount' =>   array (    0 => 'INT',    1 => 11,    2 => '使用次数',  ),  'created' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '创建时间',  ),);
    }


}